/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sporejava;

/**
 *
 * @author Exodus
 */
public abstract class Animal extends EtreVivant{
    
    
    private String nomAnimal;
    private int nivFaim;
    private String sexe;

    public Animal(String nomEspece,  String nom, String baseAdn, int identifiant, String ADN, int[] position) {
        super(nomEspece, baseAdn, identifiant, ADN, position);
        this.nomAnimal = nom;
        this.nivFaim = 0;
        this.sexe = (Math.random() < 0.5)?"M":"F";
    }

    public int getNivFaim() {
        return nivFaim;
    }

    public String getNomAnimal() {
        return nomAnimal;
    }

    public void setNivFaim(int nivFaim) {
        this.nivFaim = nivFaim;
    }

    public void setNomAnimal(String nomAnimal) {
        this.nomAnimal = nomAnimal;
    }

   

   
    public void dormir(){
        
    }
    
    public abstract void manger(EtreVivant e);
        
       
    
    public void tuer(EtreVivant etreVivant){
        
        etreVivant.setSante(0);
        
    }
    
    public String getSexe(){
        return this.sexe;
    }
    
    public void setSexe(String sexe){
        this.sexe = sexe;
    }
 
    public void afficherAnimal(){
        this.afficherEtreVivant();
        System.out.println("- Nom : " + this.nomAnimal +  " - Faim : " + this.nivFaim + " - Sexe : " + this.sexe);
    }
    
    
}
